// pages/myCardClient/expenseCalender/expenseCalender.js
const app = getApp()
const HttpReq = require('../../../utils/HttpReq.js')

Page({

    /**
     * 页面的初始数据
     */
    data: {
      message: '',
      phone: '',
      expenseCalenderList:[
        {
          "id": "1684519645870764319",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": null,
          "remark": "在代码小店办理储值卡，剩余1000.0元",
          "isDeleted": 0,
          "consumerTime": "2023-09-12 17:14:39",
          "retailerId": 19,
          "storeId": 1657413650,
          "jifen": null,
          "price": 500.00,
          "dealType": 0,
          "balanceMoney": 1000.00,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": "代码小店",
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764373",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": null,
          "remark": "在代码小店使用了1张上网充值减免券优惠券",
          "isDeleted": 0,
          "consumerTime": "2023-09-26 02:19:08",
          "retailerId": 19,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 3,
          "balanceMoney": null,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": "代码小店",
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764374",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": null,
          "remark": "在代码小店使用了1张榨菜大礼包优惠券",
          "isDeleted": 0,
          "consumerTime": "2023-09-26 02:19:12",
          "retailerId": 19,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 3,
          "balanceMoney": null,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": "代码小店",
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764410",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 25.00,
          "remark": "在代码小店使用了储值卡，消费金额为25.0,该卡的余额为975.00,本次消费获赠积分:125分",
          "isDeleted": 0,
          "consumerTime": "2023-10-13 21:52:34",
          "retailerId": 4360,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 975.00,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764415",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 0.50,
          "remark": "在代码小店使用了储值卡，消费金额为0.5,该卡的余额为974.50,本次消费获赠积分:2分",
          "isDeleted": 0,
          "consumerTime": "2023-10-22 10:09:53",
          "retailerId": 4360,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 974.50,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764430",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 0.50,
          "remark": "在代码小店使用了储值卡，消费金额为0.50,该卡的余额为974.00,本次消费获赠积分:2分",
          "isDeleted": 0,
          "consumerTime": "2023-10-24 12:58:07",
          "retailerId": 14,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 974.00,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764431",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 0.50,
          "remark": "在代码小店使用了储值卡，消费金额为0.50,该卡的余额为973.50,本次消费获赠积分:2分",
          "isDeleted": 0,
          "consumerTime": "2023-10-24 12:58:29",
          "retailerId": 14,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 973.50,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764432",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 0.50,
          "remark": "在代码小店使用了储值卡，消费金额为0.50,该卡的余额为973.00,本次消费获赠积分:2分",
          "isDeleted": 0,
          "consumerTime": "2023-10-24 12:59:49",
          "retailerId": 14,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 973.00,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        },
        {
          "id": "1684519645870764433",
          "clientId": null,
          "cardClientId": 1684519645807849541,
          "type": 3,
          "time": null,
          "money": 0.50,
          "remark": "在代码小店使用了储值卡，消费金额为0.50,该卡的余额为972.50,本次消费获赠积分:2分",
          "isDeleted": 0,
          "consumerTime": "2023-10-24 12:59:50",
          "retailerId": 14,
          "storeId": 1657413650,
          "jifen": null,
          "price": null,
          "dealType": 1,
          "balanceMoney": 972.50,
          "balanceJifen": null,
          "balanceTimes": null,
          "storeName": null,
          "validPeriod": null,
          "phoneNumber": "13109791246",
          "clientName": "笪豪俊"
        }
      
      ]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
      this.setData({
        cardClientId: options.cardClientId
      })
      let that = this
      let url = app.globalData.hostIp + '/weixin/queryExpenseCalendarByCardClientId/' + options.cardClientId
      HttpReq.httpsResquest(url, null, 'GET').then(res=>{
        if(res.code == 1){
          console.log(res.data)
          that.setData({
            expenseCalenderList: res.data
          })
        }else{
          wx.showToast({
            title: '数据加载失败',
            duration: 1000,
            icon:'error'
          })
        }
      })

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})